#pragma once
#include "AnimationController.h"
#include "AnimationClip.h"
#include "AnimationSampler.h"

namespace Graphics{
	class AnimationManager{
	public:
		AnimationManager();

		void update(float dt, RenderContext* context);

		unsigned int addAnimationController(AnimationControllerPtr controller);
		unsigned int addAnimationClip(AnimationClipPtr clip);
		unsigned int addAnimationSampler(AnimationSamplerPtr sampler);

		void removeAnimationController(unsigned int id);
		void removeAnimationClip(unsigned int id);
		void removeAnimationSampler(unsigned int id);

		AnimationControllerPtr getAnimationController(unsigned int id);
		AnimationClipPtr getAnimationClip(unsigned int id);
		AnimationSamplerPtr getAnimationSampler(unsigned int id);

		void addAnimatedMeshPtr(MeshPtr mesh);
		void removeAnimatedMeshPtr(MeshPtr mesh);
	private:
		unsigned int m_animControllerId,m_animClipId,m_animSamplerId;

		std::map<unsigned int,AnimationControllerPtr> m_animationControllers;
		std::map<unsigned int,AnimationClipPtr> m_animationClips;
		std::map<unsigned int,AnimationSamplerPtr> m_animationSamplers;

		std::set<MeshPtr> m_meshes;
	};
}

typedef boost::shared_ptr<Graphics::AnimationManager> AnimationManagerPtr;